<ul id="breadcrumb">
	<li><a href="question">ถาม - ตอบ</a></li>
	<li><?php echo $question['title'] ?></li>			
</ul>

	<ul id="question">
		<div class="question-title"><?php echo $question['title'] ?></div>
		<li class="question">
			
			<div class="question-detail">
				<?php echo nl2br($question['detail']) ?><br />
				<?php if(!empty($question['updated'])): ?>
				<div class="question_edit">
					-- แก้ไขล่าสุดเมื่อ <?php echo db_to_th(date('Y-m-d H:i:s',$question['updated']),TRUE) ?> --
				</div>
				<?php endif; ?>
				<div class="description">
				<span class="name"><?php echo get_one('concat(firstname,concat(\' \',lastname))','users','id',$question['user_id']) ?></span>  
				<span class="time"><?php echo db_to_th(date('Y-m-d H:i:s',$question['created']),TRUE) ?></span>
				<?php if($question['user_id']==login_data('id')): ?>
				<span class="option">
					[ <a href="question/form/<?php echo $question['id'] ?>">แก้ไข</a> - 
					<a href="question/delete/<?php echo $question['id'] ?>" onclick="return confirm('ยืนยันการลบคำถาม')" >ลบ</a> ]
				</span>
				<?php endif; ?>
				</div>
			</div>
		</li>
		<?php foreach($answers as $key => $answer): ?>
		<li class="answer-detail">
			<div>
				<div class="answer_id">คำตอบที่ <?php echo ++$key ?></div>
				<?php echo nl2br($answer['detail']) ?>
				<div class="description">
				<span class="name"><?php echo get_one('concat(firstname,concat(\' \',lastname))','users','id',$answer['user_id']) ?></span>  
				<span class="time"><?php echo db_to_th(date('Y-m-d H:i:s',$answer['created']),TRUE) ?></span>
				<?php if($answer['user_id']==login_data('id')): ?>
				<span class="option">
					[ <a href="question/answer_form/<?php echo $answer['id'] ?>">แก้ไข</a> - 
					<a href="question/answer_delete/<?php echo $answer['id'] ?>" onclick="return confirm('ยืนยันการลบคำตอบ')" >ลบ</a> ]
				</span>
				<?php endif; ?>
				</div>
			</div>
		</li>
		<?php endforeach; ?>
	</ul>
	<div class="answer-title">ตอบคำถาม</div>
	<div class="answer">
		<form action="question/answer_save" method="post">
			<?php echo form_textarea('detail',$rs['detail'],'style="width:600px;"') ?></td>
			<div><input class="button" type="submit" value="ตอบคำถาม" /></div>
			<?php echo form_hidden('question_id',$question['id']) ?>
		</form>
	</div>

